#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int iceBreakingGame(int num, int target) {
        int ret = 0;
        for (int i = 2; i <= num; i++)
        {
            ret = (target + ret) % i;
        }
        return ret;
    }
};